package cn.agiledata.bank.myspace.service;

import cn.agiledata.bank.common.util.PageBean;
import cn.agiledata.bank.hibernateBean.PeerBankAccount;
import cn.agiledata.bank.hibernateBean.PeerInnerAccount;
import cn.agiledata.bank.myspace.bean.PeerBankAccountBean;
import cn.agiledata.bank.myspace.bean.PeerBankAccountQueryBean;
import cn.agiledata.bank.myspace.bean.PeerInnerAccountBean;
import cn.agiledata.bank.myspace.bean.PeerInnerAccountQueryBean;
import cn.agiledata.bank.myspace.exception.MySpaceException;

public interface PeerAccountService {
	
	/**
	 * 根据联系人id得到联系人
	 * @param id
	 * @return
	 */
	public PeerInnerAccount getPeerInnerAccount(long id);
	/**
	 * 得到关联账户列表
	 * @param bean
	 * @return
	 */
	public PageBean getPeerInnerAccountList(PeerInnerAccountQueryBean bean);
	/**
	 * 验证输入的Email或者手机是否合乎规则
	 * @param emailOrMobile
	 * @return
	 * @throws MySpaceException
	 */
	public String validateEmailOrMobile(String emailOrMobile,String myAccountId) throws MySpaceException;
	/**
	 * 保存关联账户
	 * @param p
	 */
	public void peerInnerAccountAdd(PeerInnerAccountBean bean) throws MySpaceException;
	/**
	 * 修改关联账户
	 * @param id
	 * @throws MySpaceException
	 */
	public void peerInnerAccountModify(PeerInnerAccountBean bean)  throws MySpaceException;
	/**
	 * 删除关联账户
	 * @param id
	 */
	public void peerInnerAccountDelete(String id);

	/**
	 * 得到银行账户列表
	 * @param bean
	 * @return
	 */
	public PageBean getPeerBankAccountList(PeerBankAccountQueryBean bean);
	
	/**
	 * 根据联系人id得到银行联系人
	 * @param peerAccountId
	 * @return
	 */
	public PeerBankAccount getPeerBankAccount(long peerAccountId);
	
	/**
	 * 新增银行联系人
	 * @param bean
	 * @throws MySpaceException
	 */
	public void peerBankAccountAdd(PeerBankAccountBean bean) throws MySpaceException;
	
	/**
	 * 修改银行联系人
	 * @param bean
	 * @throws MySpaceException
	 */
	public void peerBankAccountModify(PeerBankAccountBean bean)  throws MySpaceException;
	
	/**
	 * 删除银行联系人
	 * @param peerAccountId
	 */
	public void peerBankAccountDelete(String peerAccountId);
	
	/**
	 * 验证是否是新的银行联系人(不重复,可添加)
	 * @param myAccountId
	 * @param cardNo
	 * @return
	 */
	public boolean isNewPeerBankAccount(String myAccountId, String cardNo);
	
	/**
	 * 新增银行联系人(在提交账户直付信息之前)
	 * @param bean
	 * @return
	 */
	public int peerBankAccountAddBeforeDrawToOther(PeerBankAccountBean bean);
}
